#ifndef CHAT_H
#define CHAT_H

#include <QFile>
#include <QWidget>
#include <QProgressDialog>
#include "sendfile.h"

namespace Ui {
class Chat;
}

class Chat : public QWidget
{
    Q_OBJECT

public:
    explicit Chat(QString name_, QString _id, QString name, QString id_, QWidget *parent = 0);
    ~Chat();
    QString uname;
    QString id;
    QString myname;
    QString myid;
    void recvMsg(QString msg);
    void recvFileText(QString data_);
    void recvGroupMsg(QString from, QString msg);
    int flag = 0;
    QFile *file;
    SendFile *worker;
    QProgressDialog *dlg;

signals:
    void sendId_Msg(QString fid, QString id, QString msg);
    void sendFileContent(QString from, QString to, int size, QString data);
    void sendTp(QString tp);
    void sendNoSay(QString nosay);
    void sendOpenSay(QString opensay);

private slots:
    void on_send_clicked();
    void on_sendFile_clicked();

    void on_tiPeople_clicked();

    void on_noSay_clicked();

    void on_openSay_clicked();

private:
    Ui::Chat *ui;
};

#endif // CHAT_H
